home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / DHTML - Mouse and Cursor / curosr-trailer-text2.izs < prev    next >
Text File  |  2005-09-02  |  7KB  |  188 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Cursor Trailer Text II
  4. <!/TITLE>
  5.  
  6. <!BROWSER>IE5+ Opr7+<!/BROWSER>
  7.  
  8. <!DESCRIPTION> This cursor trail effect renders multiple copies of a text that follow the mouse around in a delayed fashion. Definitely an interesting spectacle, and one that can be configured to automatically be dismissed after x seconds. One great use of this script is to brand your domain name using it, as in demo.
  9. <!/DESCRIPTION> 
  10.  
  11. <!CATEGORY>mouse and cursor<!/CATEGORY>
  12.  
  13. <!SCRIPT>
  14. <!-- START OF SCRIPT -->
  15. <SCRIPT language=JavaScript1.2>
  16. <!--
  17.  
  18. /*
  19. Cursor Trailer II (By Kurt at kurt.grigg@virgin.net)
  20. Modified and featured on Dynamicdrive.com
  21. For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
  22. */
  23.  
  24. var message='Dynamicdrive.com';
  25. var messagecolor='#000000'
  26.  
  27. //Enter number of seconds for message to display  (0=perpetual)
  28. var dismissafter=0
  29.  
  30. ///no need to edit below/////////
  31. var amount=5,ypos=0,xpos=0,Ay=0,Ax=0,By=0,Bx=0,Cy=0,Cx=0,Dy=0,Dx=0,Ey=0,Ex=0;
  32. if (document.layers){
  33. for (i = 0; i < amount; i++)
  34. {document.write('<layer name=ns'+i+' top=0 left=0><font face="Courier New" size=3 color='+messagecolor+'>'+message+'</font></layer>')}
  35. window.captureEvents(Event.MOUSEMOVE);
  36. function nsmouse(evnt){xpos = evnt.pageX;ypos = evnt.pageY;makefollow()}
  37. }
  38. else if (document.all){
  39. document.write("<div id='outer' style='position:absolute;top:0px;left:0px'>");
  40. document.write("<div id='inner' style='position:relative'>");
  41. for (i = 0; i < amount; i++) 
  42. {document.write('<div id="text"'+i+' style="position:absolute;top:0px;left:0px;font-family:Courier New;font-size:16px;color:'+messagecolor+'">'+message+'</div>')}
  43. document.write("</div>");
  44. document.write("</div>");
  45. function iemouse(){ypos = document.body.scrollTop + event.y;xpos = document.body.scrollLeft + event.x;makefollow()}
  46. }
  47. function makefollow(){
  48. if (document.layers){
  49. document.layers["ns0"].top=ay;document.layers["ns0"].left=ax;
  50. document.layers["ns1"].top=by;document.layers["ns1"].left=bx;
  51. document.layers["ns2"].top=cy;document.layers["ns2"].left=cx;
  52. document.layers["ns3"].top=Dy;document.layers["ns3"].left=Dx;
  53. document.layers["ns4"].top=Ey;document.layers["ns4"].left=Ex;
  54. }
  55. else if (document.all){
  56. outer.all.inner.all[0].style.pixelTop=ay;outer.all.inner.all[0].style.pixelLeft=ax;
  57. outer.all.inner.all[1].style.pixelTop=by;outer.all.inner.all[1].style.pixelLeft=bx;
  58. outer.all.inner.all[2].style.pixelTop=cy;outer.all.inner.all[2].style.pixelLeft=cx;
  59. outer.all.inner.all[3].style.pixelTop=Dy;outer.all.inner.all[3].style.pixelLeft=Dx;
  60. outer.all.inner.all[4].style.pixelTop=Ey;outer.all.inner.all[4].style.pixelLeft=Ex;
  61. }
  62. }
  63. function move(){
  64. if (dismissafter!=0)
  65. setTimeout("hidetrail()",dismissafter*1000)
  66.  
  67. if (document.layers){window.onMouseMove = nsmouse}
  68. else if (document.all){window.document.onmousemove = iemouse}
  69. ey = Math.round(Ey+=((ypos+20)-Ey)*2/2);ex = Math.round(Ex+=((xpos+20)-Ex)*2/2);
  70. dy = Math.round(Dy+=(ey - Dy)*2/4);dx = Math.round(Dx+=(ex - Dx)*2/4);
  71. cy = Math.round(Cy+=(dy - Cy)*2/6);cx = Math.round(Cx+=(dx - Cx)*2/6);
  72. by = Math.round(By+=(cy - By)*2/8);bx = Math.round(Bx+=(cx - Bx)*2/8);
  73. ay = Math.round(Ay+= (by - Ay)*2/10);ax = Math.round(Ax+= (bx - Ax)*2/10);
  74. makefollow();
  75. jumpstart=setTimeout('move()',10);
  76. }
  77.  
  78. function hidetrail(){
  79. if (document.all){
  80. for (i2=0;i2<amount;i2++){
  81. outer.all.inner.all[i2].style.visibility="hidden"
  82. clearTimeout(jumpstart)
  83. }
  84. }
  85. else if (document.layers){
  86. for (i2=0;i2<amount;i2++){
  87. temp="ns"+i2
  88. document.layers[temp].visibility="hide"
  89. clearTimeout(jumpstart)
  90. }
  91. }
  92. }
  93.  
  94. window.onload=move;
  95. //-->
  96. </SCRIPT>
  97. <!-- END OF SCRIPT -->
  98. <!/SCRIPT>
  99.  
  100. <!PREVIEW>
  101. <!-- START OF SCRIPT -->
  102.  
  103. <SCRIPT language=JavaScript1.2>
  104. <!--
  105.  
  106. /*
  107. Cursor Trailer II (By Kurt at kurt.grigg@virgin.net)
  108. Modified and featured on Dynamicdrive.com
  109. For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
  110. */
  111.  
  112. var message='Dynamicdrive.com';
  113. var messagecolor='#000000'
  114.  
  115. //Enter number of seconds for message to display  (0=perpetual)
  116. var dismissafter=0
  117.  
  118. ///no need to edit below/////////
  119. var amount=5,ypos=0,xpos=0,Ay=0,Ax=0,By=0,Bx=0,Cy=0,Cx=0,Dy=0,Dx=0,Ey=0,Ex=0;
  120. if (document.layers){
  121. for (i = 0; i < amount; i++)
  122. {document.write('<layer name=ns'+i+' top=0 left=0><font face="Courier New" size=3 color='+messagecolor+'>'+message+'</font></layer>')}
  123. window.captureEvents(Event.MOUSEMOVE);
  124. function nsmouse(evnt){xpos = evnt.pageX;ypos = evnt.pageY;makefollow()}
  125. }
  126. else if (document.all){
  127. document.write("<div id='outer' style='position:absolute;top:0px;left:0px'>");
  128. document.write("<div id='inner' style='position:relative'>");
  129. for (i = 0; i < amount; i++) 
  130. {document.write('<div id="text"'+i+' style="position:absolute;top:0px;left:0px;font-family:Courier New;font-size:16px;color:'+messagecolor+'">'+message+'</div>')}
  131. document.write("</div>");
  132. document.write("</div>");
  133. function iemouse(){ypos = document.body.scrollTop + event.y;xpos = document.body.scrollLeft + event.x;makefollow()}
  134. }
  135. function makefollow(){
  136. if (document.layers){
  137. document.layers["ns0"].top=ay;document.layers["ns0"].left=ax;
  138. document.layers["ns1"].top=by;document.layers["ns1"].left=bx;
  139. document.layers["ns2"].top=cy;document.layers["ns2"].left=cx;
  140. document.layers["ns3"].top=Dy;document.layers["ns3"].left=Dx;
  141. document.layers["ns4"].top=Ey;document.layers["ns4"].left=Ex;
  142. }
  143. else if (document.all){
  144. outer.all.inner.all[0].style.pixelTop=ay;outer.all.inner.all[0].style.pixelLeft=ax;
  145. outer.all.inner.all[1].style.pixelTop=by;outer.all.inner.all[1].style.pixelLeft=bx;
  146. outer.all.inner.all[2].style.pixelTop=cy;outer.all.inner.all[2].style.pixelLeft=cx;
  147. outer.all.inner.all[3].style.pixelTop=Dy;outer.all.inner.all[3].style.pixelLeft=Dx;
  148. outer.all.inner.all[4].style.pixelTop=Ey;outer.all.inner.all[4].style.pixelLeft=Ex;
  149. }
  150. }
  151. function move(){
  152. if (dismissafter!=0)
  153. setTimeout("hidetrail()",dismissafter*1000)
  154.  
  155. if (document.layers){window.onMouseMove = nsmouse}
  156. else if (document.all){window.document.onmousemove = iemouse}
  157. ey = Math.round(Ey+=((ypos+20)-Ey)*2/2);ex = Math.round(Ex+=((xpos+20)-Ex)*2/2);
  158. dy = Math.round(Dy+=(ey - Dy)*2/4);dx = Math.round(Dx+=(ex - Dx)*2/4);
  159. cy = Math.round(Cy+=(dy - Cy)*2/6);cx = Math.round(Cx+=(dx - Cx)*2/6);
  160. by = Math.round(By+=(cy - By)*2/8);bx = Math.round(Bx+=(cx - Bx)*2/8);
  161. ay = Math.round(Ay+= (by - Ay)*2/10);ax = Math.round(Ax+= (bx - Ax)*2/10);
  162. makefollow();
  163. jumpstart=setTimeout('move()',10);
  164. }
  165.  
  166. function hidetrail(){
  167. if (document.all){
  168. for (i2=0;i2<amount;i2++){
  169. outer.all.inner.all[i2].style.visibility="hidden"
  170. clearTimeout(jumpstart)
  171. }
  172. }
  173. else if (document.layers){
  174. for (i2=0;i2<amount;i2++){
  175. temp="ns"+i2
  176. document.layers[temp].visibility="hide"
  177. clearTimeout(jumpstart)
  178. }
  179. }
  180. }
  181.  
  182. window.onload=move;
  183. //-->
  184. </SCRIPT>
  185. <!-- END OF SCRIPT -->
  186. <!/PREVIEW>
  187.  
  188. <!RELATED>NONE<!/RELATED>